fix(bundler): reject non-UTF-8 zipped manifests consistently - #3958
Open
marcelsafin wants to merge 1 commit into
Open
fix(bundler): reject non-UTF-8 zipped manifests consistently#3958marcelsafin wants to merge 1 commit into
marcelsafin wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Wraps ZIP bundle-manifest YAML parsing failures in BundlerError.
Changes:
- Handles malformed or undecodable ZIP manifest data.
- Adds regression tests for malformed YAML and invalid encoding.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/specify_cli/commands/bundle/__init__.py |
Wraps ZIP manifest parsing errors. |
tests/integration/test_bundler_local_install.py |
Tests YAML and decoding failures. |
馃挕 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Review follow-up: feeding PyYAML the byte stream let its Reader honour a UTF-16 BOM and accept a manifest yamlio.load_yaml rejects, so zip and directory sources diverged. Decode raw as UTF-8 (UnicodeError -> BundlerError 'Could not read ...') then parse, and cover a well-formed UTF-16 manifest in the regression tests. Assisted-by: GitHub Copilot (model: claude-fable-5, autonomous) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
marcelsafin
force-pushed
the
fix/bundle-zip-manifest-yaml
branch
from
August 7, 2026 21:21
e1898e5 to
a3c07a1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
A local bundle directory or plain
bundle.ymlis decoded strictly as UTF-8 throughyamlio.load_yaml, but the.zippath feeds raw bytes to PyYAML. PyYAML auto-detects a UTF-16 BOM, so a UTF-16 manifest rejected by the other two local-source paths is silently accepted from a zip. Other undecodable bytes also surface through PyYAML instead of the sharedCould not read ...contract.Fix: decode the bounded zip member explicitly as UTF-8 before parsing. Decode failures now raise
BundlerErrorwith the sameCould not readwording asyamlio; YAML parse handling remains from #4013.This PR originally also wrapped malformed YAML. #4013 merged that independently, so the branch was rebased and that overlapping commit/test was dropped. The remaining one-commit diff only covers the still-missing encoding consistency.
Testing
uvx ruff@0.15.0 check src testsgit diff --checkAI Disclosure
Implemented autonomously by GitHub Copilot CLI (model: Claude Fable 5) under human direction; TDD, full suite, lint, rebase, and final diff review completed locally. Commit includes
Assisted-by/Co-authored-bytrailers.